<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateDepartamentoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateDepartamentoLabel_codigo}" for="codigo" />
                    <h:inputText id="codigo" value="#{departamentoController.selected.codigo}" title="#{bundle.CreateDepartamentoTitle_codigo}" required="true" requiredMessage="#{bundle.CreateDepartamentoRequiredMessage_codigo}"/>
                    <h:outputLabel value="#{bundle.CreateDepartamentoLabel_nombre}" for="nombre" />
                    <h:inputText id="nombre" value="#{departamentoController.selected.nombre}" title="#{bundle.CreateDepartamentoTitle_nombre}" required="true" requiredMessage="#{bundle.CreateDepartamentoRequiredMessage_nombre}"/>
                    <h:outputLabel value="#{bundle.CreateDepartamentoLabel_descripcion}" for="descripcion" />
                    <h:inputText id="descripcion" value="#{departamentoController.selected.descripcion}" title="#{bundle.CreateDepartamentoTitle_descripcion}" />
                    <h:outputLabel value="#{bundle.CreateDepartamentoLabel_presupuesto}" for="presupuesto" />
                    <h:inputText id="presupuesto" value="#{departamentoController.selected.presupuesto}" title="#{bundle.CreateDepartamentoTitle_presupuesto}" />
                    <h:outputLabel value="#{bundle.CreateDepartamentoLabel_centrodecosto}" for="centrodecosto" />
                    <h:inputText id="centrodecosto" value="#{departamentoController.selected.centrodecosto}" title="#{bundle.CreateDepartamentoTitle_centrodecosto}" />
                    <h:outputLabel value="#{bundle.CreateDepartamentoLabel_director}" for="director" />
                    <h:selectOneMenu id="director" value="#{departamentoController.selected.director}" title="#{bundle.CreateDepartamentoTitle_director}" required="true" requiredMessage="#{bundle.CreateDepartamentoRequiredMessage_director}">
                        <f:selectItems value="#{empleadoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{departamentoController.create}" value="#{bundle.CreateDepartamentoSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{departamentoController.prepareList}" value="#{bundle.CreateDepartamentoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateDepartamentoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
